﻿using System;
using UnityEngine;
using UnityEngine.UI;

namespace SizeboxUI
{
	// Token: 0x020003B5 RID: 949
	public class KeyBindInput : MonoBehaviour
	{
		// Token: 0x060019AE RID: 6574 RVA: 0x000A0B34 File Offset: 0x0009ED34
		private void OnGUI()
		{
			Event current = Event.current;
			if (current.isKey && current.keyCode != KeyCode.None)
			{
				if (current.keyCode == KeyCode.Escape || current.keyCode == KeyCode.Backspace)
				{
					base.gameObject.GetComponentInChildren<Button>().GetComponentInChildren<Text>().text = "'" + this.oldKeyName + "'";
					UnityEngine.Object.Destroy(this);
					return;
				}
				base.gameObject.GetComponentInChildren<Button>().GetComponentInChildren<Text>().text = "'" + ((!current.shift && !current.capsLock) ? current.keyCode.ToString().ToLower() : current.keyCode.ToString().ToUpper()) + "'";
				UnityEngine.Object.Destroy(this);
			}
		}

		// Token: 0x04001BB3 RID: 7091
		public string oldKeyName;
	}
}
